-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Do not let ShardBulkInferenceActionFilter unwrap / rewrap ESExceptions #123890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not let ShardBulkInferenceActionFilter unwrap / rewrap ESExceptions #123890
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we made a new exception type that implemented ElasticsearchWrapperException and always wrapped the exception caught by the failure handler? Something like SearchException in that it takes a message but also takes a cause, and the cause is used to determine the REST status. I see a few benefits to this approach:
- We can still insert a message indicating that the error happened when performing inference for semantic text, which helps for traceability.
- The REST status will always be indicative of the wrapped exception. For example, if the wrapped exception is
IllegalArgumentExceptionthe REST status will be 400.
WDYT?
…k_bubbleup_exceptions1
|
@Mikep86 your proposal sounds good to me, thanks! |
|
Hi @tteofili, I've created a changelog YAML for you. |
…elasticsearch into shardbulk_bubbleup_exceptions1
|
added new |
…k_bubbleup_exceptions1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice simple approach, love it! Can we add a test showing that this works as expected?
Edit: We should be able to extend testItemFailures to cover this
x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/InferenceException.java
Outdated
Show resolved
Hide resolved
...ava/org/elasticsearch/xpack/inference/action/filter/ShardBulkInferenceActionFilterTests.java
Outdated
Show resolved
Hide resolved
...ava/org/elasticsearch/xpack/inference/action/filter/ShardBulkInferenceActionFilterTests.java
Outdated
Show resolved
Hide resolved
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for working on this!
elastic#123890) * do not let ShardBulkInferenceActionFilter unwrap / rewrap ESExceptions
💔 Backport failed
You can use sqren/backport to manually backport by running |
elastic#123890) * do not let ShardBulkInferenceActionFilter unwrap / rewrap ESExceptions
elastic#123890) * do not let ShardBulkInferenceActionFilter unwrap / rewrap ESExceptions
elastic#123890) * do not let ShardBulkInferenceActionFilter unwrap / rewrap ESExceptions (cherry picked from commit 74bb0f9) # Conflicts: # x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/filter/ShardBulkInferenceActionFilter.java
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
elastic#123890) * do not let ShardBulkInferenceActionFilter unwrap / rewrap ESExceptions (cherry picked from commit 74bb0f9) # Conflicts: # x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/filter/ShardBulkInferenceActionFilter.java
…ceptions (#123890) (#124359) * Do not let ShardBulkInferenceActionFilter unwrap / rewrap ESExceptions (#123890) * do not let ShardBulkInferenceActionFilter unwrap / rewrap ESExceptions (cherry picked from commit 74bb0f9) # Conflicts: # x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/filter/ShardBulkInferenceActionFilter.java * Add missing import --------- Co-authored-by: Tommaso Teofili <[email protected]>
…ceptions (#123890) (#124358) * Do not let ShardBulkInferenceActionFilter unwrap / rewrap ESExceptions (#123890) * do not let ShardBulkInferenceActionFilter unwrap / rewrap ESExceptions (cherry picked from commit 74bb0f9) # Conflicts: # x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/filter/ShardBulkInferenceActionFilter.java * Add missing import --------- Co-authored-by: Tommaso Teofili <[email protected]>
elastic#123890) * do not let ShardBulkInferenceActionFilter unwrap / rewrap ESExceptions
see #123731